/*******************************************************************************
 * Copyright (c) 2000, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Author:
 *     coolair.loveU2@gmail.com
 *******************************************************************************/

package org.skyfree.ghyll.tcard.core;

import java.util.ArrayList;
import java.util.TreeSet;

import org.eclipse.core.runtime.IAdaptable;

/**
 * Repository manages all the WorkPieces with its way.
 */

public interface ITRepository extends IAdaptable,ITResource
{
	/**
	 * Returns all the category name of this repository
	 * @return
	 */
	Object[] getAllCategory();
	
	/**
	 * Returns All the WorkPiece in the category of this Repository.
	 * @param category name of category
	 * @return All the WorkPiece in the category. 
	 */
	TreeSet<ITWorkpiece> getWorkPiece(String category);
	
	/**
	 * Returns specific WorkPiece with provided ID.
	 * @param uniqueID the WorkPiece's Unique ID
	 * @return specific WorkPiece
	 */
	ITWorkpiece getWorkpiece(String uniqueID);
	
	void createCategory(String name) throws Exception;
	
	void deleteCategory(String name,boolean force) throws Exception;
	
	void reload(String category)throws Exception;

	boolean exist(String text);
	
	ArrayList<ITWorkpiece> searchWorkPiece(String partName);
		
}
